package Impl;

import Bean.BeanTeacher;
import Dao.TeacherDao;
import Service.TeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service("TeacherServiceImpl")
public class TeacherServiceImpl implements TeacherService {
    @Resource(name="TeacherDAO")
    TeacherDao teacherDao;

    public TeacherDao getTeacherDao() {
        return teacherDao;
    }

    public void setTeacherDao(TeacherDao teacherDao) {
        this.teacherDao = teacherDao;
    }


    @Override
    public void teacheradd(String teacherid, String pwd, String teachername, String teacher_photo, String teacher_introduction) throws Exception {
        teacherDao.teacheradd(teacherid,pwd,teachername,teacher_photo,teacher_introduction);
    }

    @Override
    public void teacherupdate(String teacherid, String teachername, String pwd, String teacher_photo, String teacher_introduction) throws Exception {
        teacherDao.teacherupdate(teacherid,teachername,pwd,teacher_photo,teacher_introduction);
    }

    @Override
    public void teacherdelete(String teacherid) throws Exception {
        teacherDao.teacherdelete(teacherid);
    }

    @Override
    public ArrayList<BeanTeacher> getTeachers() throws Exception {
        return teacherDao.getTeachers();
    }

    @Override
    public ArrayList<BeanTeacher> getTeachersByKeyword(String keyword) throws Exception {
        return teacherDao.getTeachersByKeyword(keyword);
    }
}
